//
//  HLEViewController.m
//  HLELowcostPeripherial
//
//  Created by ldb on 05/04/2021.
//  Copyright (c) 2021 ldb. All rights reserved.
//

#import "HLEViewController.h"
#import <HLELowcostPeripherial/HLELowcostPeripherial.h>
#import <YYCategories/YYCategories.h>

@interface HLEViewController ()
@property(nonatomic, strong) IBOutlet UITextField *textField;
@end

@implementation HLEViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.    

    
//    [HLELowcostScheduler setDeviceBind:@"33445502" delay:0.8 serialNum:@"SC1TW3DC21170006" complete:^(BOOL isSuccess, NSData * _Nonnull data) {
//        NSLog(@"=========");
//    }];
//    [HLELowcostScheduler setDeviceConnectBySerialNum:@"SC0811HCLYDK000F" complete:^(BOOL isSuccess, NSData * _Nonnull data) {
//        NSLog(@"=========");
//    }];
    
    [HLELowcostBleManager.sharedInstance.heartbeatSubject subscribeNext:^(RACTuple * _Nullable x) {
        RACTupleUnpack(NSData *string1, NSString *string2) = x;
        NSLog(@"=========");
    }];
}


- (IBAction)senderMsg:(id)sender {
//    [HLELowcostBleManager.sharedInstance sendMsgBySerialNum:@"SC1TW3DC21170000" data:[self getData] result:^{
//        NSLog(@"=========Block回调");
//    }];
    [HLELowcostScheduler setDeviceDisConnectBySerialNum:@"SC0811HCLYDK000F" delay:0.8];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
    
    [HLELowcostScheduler setDeviceBind:@"33445502" delay:0.8 serialNum:@"SC1TW3DC21170006" complete:^(BOOL isSuccess, NSData * _Nonnull data) {
        NSLog(@"=========");
    }];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
